import request from '../utils/request'


export const uploadSingle = (fileData, callback) => {
    return request({
        url: '/upload_single',
        method: 'POST',
        // 指定类型
        headers: {
            "Content-Type": "multipart/form-data"
        },
        onUploadProgress: function (progressEvent) {
            const loaded = progressEvent.loaded;
            const total = progressEvent.total;
            callback(loaded, total);
        },
        data: fileData
    })
}